import request from '../../../../../public/js/common/api/api.js';

// const AuxBizUrl = 'http://172.10.254.69:23100/api';
const AuxBizUrl = Utils.CurDomain.AuxBizUrl;
const MasterDataUrl = Utils.CurDomain.MasterDataUrl
const SysPlfUrl = Utils.CurDomain.SysPlfUrl;


const _ajaxOptions = {
	contentType: 'application/json',
	dataType: 'text',
	async: true,
	dataFilter(data, type) {
		return data;
	}
};

/**
 * 生猪采购计划 接口
 */
export default class PigProcurementPlanApi {

	/**
	 * 查询生猪采购计划分页列表
	 * @param data
	 * @returns
	 */
	static getPigPurchasePlanList(data) {
		return request.post(`${AuxBizUrl}/pigpurchaseplans/list`, data);
	}

	/**
	 * 创建生猪采购计划
	 * @param data
	 * @returns
	 */
	static createPigPurchasePlan(data) {
		return request.post(`${AuxBizUrl}/pigpurchaseplans`, data, true, _ajaxOptions);
	}

	/**
	 * 获取组织信息
	 * @param data
	 * @returns
	 */
	static getOrgInfo(upoid, aotype) {
		return request.get(`${SysPlfUrl}/yyorgunits/by/q?upoid=${upoid}&aotype=${aotype}`);
	}

}